<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="车牌号码" prop="vehicleLicenseNumber">
        <el-input
          v-model="queryParams.vehicleLicenseNumber"
          placeholder="请输入车牌号码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--el-form-item label="车牌颜色" prop="vehicleLicenseColor">
        <el-select v-model="queryParams.vehicleLicenseColor" placeholder="请选择车牌颜色" clearable>
          <el-option
            v-for="dict in dict.type.vehicle_license_color"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <el-form-item label="车辆类型" prop="vehicleType">
        <el-select v-model="queryParams.vehicleType" placeholder="请选择车辆类型" clearable>
          <el-option
            v-for="dict in dict.type.vehicle_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <!--el-form-item label="能源类型" prop="energyType">
        <el-select v-model="queryParams.energyType" placeholder="请选择能源类型" clearable>
          <el-option
            v-for="dict in dict.type.energy_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="排放标准" prop="exhaustEmissionStandard">
        <el-select v-model="queryParams.exhaustEmissionStandard" placeholder="请选择排放标准" clearable>
          <el-option
            v-for="dict in dict.type.exhaust_emission_standard"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <!--el-form-item label="所属单位" prop="vehicleOwner">
        <el-input
          v-model="queryParams.vehicleOwner"
          placeholder="请输入所属单位/个人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="住址" prop="vehicleAddress">
        <el-input
          v-model="queryParams.vehicleAddress"
          placeholder="请输入住址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="使用性质" prop="usePurpose">
        <el-select v-model="queryParams.usePurpose" placeholder="请选择使用性质" clearable>
          <el-option
            v-for="dict in dict.type.use_purpose"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="车辆品牌" prop="vehicleBrand">
        <el-input
          v-model="queryParams.vehicleBrand"
          placeholder="请输入车辆品牌"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车识别代号" prop="vin">
        <el-input
          v-model="queryParams.vin"
          placeholder="请输入车识别代号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="发动机号" prop="engineNumber">
        <el-input
          v-model="queryParams.engineNumber"
          placeholder="请输入发动机号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="注册日期">
        <el-date-picker
          v-model="daterangeRegisterDate"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="发证日期">
        <el-date-picker
          v-model="daterangeLicenceIssueDate"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="发证机关" prop="licenceIssueAuthority">
        <el-input
          v-model="queryParams.licenceIssueAuthority"
          placeholder="请输入发证机关"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="行驶证号" prop="driveLicenseNumber">
        <el-input
          v-model="queryParams.driveLicenseNumber"
          placeholder="请输入行驶证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="核定载人数" prop="approvePassenger">
        <el-input
          v-model="queryParams.approvePassenger"
          placeholder="请输入核定载人数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总质量" prop="totalWeight">
        <el-input
          v-model="queryParams.totalWeight"
          placeholder="请输入总质量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="整备质量" prop="massWeight">
        <el-input
          v-model="queryParams.massWeight"
          placeholder="请输入整备质量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="核定载质量" prop="approveLoadWeight">
        <el-input
          v-model="queryParams.approveLoadWeight"
          placeholder="请输入核定载质量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="准牵引总质量" prop="approveTowMass">
        <el-input
          v-model="queryParams.approveTowMass"
          placeholder="请输入准牵引总质量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="长" prop="vehicleLong">
        <el-input
          v-model="queryParams.vehicleLong"
          placeholder="请输入长"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="宽" prop="vehicleWide">
        <el-input
          v-model="queryParams.vehicleWide"
          placeholder="请输入宽"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="高" prop="vehicleHigh">
        <el-input
          v-model="queryParams.vehicleHigh"
          placeholder="请输入高"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="购买日期">
        <el-date-picker
          v-model="daterangePurchaseDate"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item-->
      <!--el-form-item label="道路运输证号" prop="transportCertificateNumber">
        <el-input
          v-model="queryParams.transportCertificateNumber"
          placeholder="请输入道路运输证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="道路经营许可证" prop="roadOperationLicense">
        <el-input
          v-model="queryParams.roadOperationLicense"
          placeholder="请输入道路经营许可证"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="车辆标记" prop="vehicleMark">
        <el-select v-model="queryParams.vehicleMark" placeholder="请选择车辆标记" clearable>
          <el-option
            v-for="dict in dict.type.vehicle_mark"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <!--el-form-item label="保险公司" prop="insuranceCompany">
        <el-input
          v-model="queryParams.insuranceCompany"
          placeholder="请输入保险公司"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="交强险单号" prop="compulsoryInsuranceNumber">
        <el-input
          v-model="queryParams.compulsoryInsuranceNumber"
          placeholder="请输入交强险单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="交强开始">
        <el-date-picker
          v-model="daterangeCompulsoryInsuranceBegin"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="交强险结束日期">
        <el-date-picker
          v-model="daterangeCompulsoryInsuranceEnd"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="交强险保费" prop="compulsoryInsurancePremium">
        <el-input
          v-model="queryParams.compulsoryInsurancePremium"
          placeholder="请输入交强险保费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="交强险理赔" prop="compulsoryInsuranceHighestClaim">
        <el-input
          v-model="queryParams.compulsoryInsuranceHighestClaim"
          placeholder="请输入交强险理赔"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商业险单号" prop="commercialInsuranceNumber">
        <el-input
          v-model="queryParams.commercialInsuranceNumber"
          placeholder="请输入商业险单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商业开始">
        <el-date-picker
          v-model="daterangeCommercialInsuranceBegin"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="商业险结束日期">
        <el-date-picker
          v-model="daterangeCommercialInsuranceEnd"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="商业险保费" prop="commercialInsurancePremium">
        <el-input
          v-model="queryParams.commercialInsurancePremium"
          placeholder="请输入商业险保费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商业险理赔" prop="commercialInsuranceHighestClaim">
        <el-input
          v-model="queryParams.commercialInsuranceHighestClaim"
          placeholder="请输入商业险理赔"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="车辆年检">
        <el-date-picker
          v-model="daterangeVehicleInspectionExpire"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="气罐年检">
        <el-date-picker
          v-model="daterangeGastankInspectionExpire"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item-->
      <!--el-form-item label="强制报废" prop="forceScrapExpire">
        <el-date-picker clearable
          v-model="queryParams.forceScrapExpire"
          style="width: 205px"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择强制报废">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
          <el-option
            v-for="dict in dict.type.vehicle_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input
          v-model="queryParams.remark"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="园区代码" prop="parkCode">
        <el-input
          v-model="queryParams.parkCode"
          placeholder="请输入园区代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <el-form-item label="创建者" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间">
        <el-date-picker
          v-model="daterangeCreateTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['vehicles:intervehicle:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['vehicles:intervehicle:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['vehicles:intervehicle:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['vehicles:intervehicle:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" @computeTable="computeTableHeight"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="intervehicleList" @selection-change="handleSelectionChange" border :height="tableHeight" :row-style="{height:'35px'}" :cell-style="{padding:'0px'}" :cell-class-name="expireTableCellClassName">
      <el-table-column type="selection" width="45" align="center" />
      <el-table-column type="index" prop="" width="55" label="序号" align="center" >
        <template slot-scope="scope">
          <span>{{ scope.$index+1 +(queryParams.pageNum-1)*queryParams.pageSize }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100%">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['vehicles:intervehicle:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['vehicles:intervehicle:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
      <!--el-table-column label="车辆ID" align="center" prop="vehicleId" /-->
      <el-table-column label="车牌号码" align="center" prop="vehicleLicenseNumber" width="110" :show-overflow-tooltip="true" />
      <!--el-table-column label="车牌颜色" align="center" prop="vehicleLicenseColor" /-->
      <el-table-column label="车辆类型" align="center" prop="vehicleType" width="120" />
      <!--el-table-column label="能源类型" align="center" prop="energyType" />
      <el-table-column label="排放标准" align="center" prop="exhaustEmissionStandard" />
      <el-table-column label="所属单位/个人" align="center" prop="vehicleOwner" width="180" :show-overflow-tooltip="true" />
      <el-table-column label="住址" align="center" prop="vehicleAddress" width="180" :show-overflow-tooltip="true" />
      <el-table-column label="使用性质" align="center" prop="usePurpose" />
      <el-table-column label="车辆品牌" align="center" prop="vehicleBrand" />
      <el-table-column label="车识别代号" align="center" prop="vin" width="180" />
      <el-table-column label="发动机号" align="center" prop="engineNumber" width="90" />
      <el-table-column label="注册日期" align="center" prop="registerDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.registerDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="发证日期" align="center" prop="licenceIssueDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.licenceIssueDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="发证机关" align="center" prop="licenceIssueAuthority" width="240" :show-overflow-tooltip="true" />
      <el-table-column label="行驶证号" align="center" prop="driveLicenseNumber" width="130" />
      <el-table-column label="核定载人数" align="center" prop="approvePassenger" width="90" />
      <el-table-column label="总质量" align="center" prop="totalWeight" />
      <el-table-column label="整备质量" align="center" prop="massWeight" />
      <el-table-column label="核定载质量" align="center" prop="approveLoadWeight" width="90" />
      <el-table-column label="准牵引总质量" align="center" prop="approveTowMass" width="110" />
      <el-table-column label="长（米）" align="center" prop="vehicleLong" />
      <el-table-column label="宽（米）" align="center" prop="vehicleWide" />
      <el-table-column label="高（米）" align="center" prop="vehicleHigh" />
      <el-table-column label="购买日期" align="center" prop="purchaseDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.purchaseDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="道路运输证号" align="center" prop="transportCertificateNumber" width="120" />
      <el-table-column label="道路经营许可证" align="center" prop="roadOperationLicense" width="160" /-->
      <!--el-table-column label="车辆标记" align="center" prop="vehicleMark" /-->
      <!--el-table-column label="保险公司" align="center" prop="insuranceCompany" width="180" />
      <el-table-column label="交强险单号" align="center" prop="compulsoryInsuranceNumber" width="210" />
      <el-table-column label="交强险开始日期" align="center" prop="compulsoryInsuranceBegin" width="120">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.compulsoryInsuranceBegin, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="交强险结束日期" align="center" prop="compulsoryInsuranceEnd" width="120">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.compulsoryInsuranceEnd, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="交强险保费" align="center" prop="compulsoryInsurancePremium" width="100"/>
      <el-table-column label="交强险理赔" align="center" prop="compulsoryInsuranceHighestClaim" width="100"/>
      <el-table-column label="商业险单号" align="center" prop="commercialInsuranceNumber" width="210"/>
      <el-table-column label="商业险开始日期" align="center" prop="commercialInsuranceBegin" width="120">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.commercialInsuranceBegin, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="商业险结束日期" align="center" prop="commercialInsuranceEnd" width="120">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.commercialInsuranceEnd, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="商业险保费" align="center" prop="commercialInsurancePremium" width="100"/>
      <el-table-column label="商业险理赔" align="center" prop="commercialInsuranceHighestClaim" width="100"/-->
      <el-table-column label="车辆年检" align="center" prop="vehicleInspectionExpire" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.vehicleInspectionExpire, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <!--el-table-column label="气罐年检" align="center" prop="gastankInspectionExpire" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.gastankInspectionExpire, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column-->
      <el-table-column label="强制报废" align="center" prop="forceScrapExpire" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.forceScrapExpire, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="车辆状态" align="center" prop="status" />
      <el-table-column label="备注" align="center" prop="remark" width="180" :show-overflow-tooltip="true" />
      <!--el-table-column label="行驶证主页" align="center" prop="drivepermitHomepagePicture" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.drivepermitHomepagePicture" :width="50" :height="25"/>
        </template>
      </el-table-column>
      <el-table-column label="行驶证副页" align="center" prop="drivepermitSubpagePicture" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.drivepermitSubpagePicture" :width="50" :height="25"/>
        </template>
      </el-table-column>
      <el-table-column label="道路运输证" align="center" prop="transportCertificatePicture" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.transportCertificatePicture" :width="50" :height="25"/>
        </template>
      </el-table-column>
      <el-table-column label="道路经营许可证" align="center" prop="operationLicensePicture" width="120">
        <template slot-scope="scope">
          <image-preview :src="scope.row.operationLicensePicture" :width="50" :height="25"/>
        </template>
      </el-table-column>
      <el-table-column label="车头照片" align="center" prop="tractorHeaderPicture" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.tractorHeaderPicture" :width="50" :height="25"/>
        </template>
      </el-table-column-->
      <!--el-table-column label="挂靠声明" align="center" prop="affiliationStatementPicture" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.affiliationStatementPicture" :width="50" :height="25"/>
        </template>
      </el-table-column-->
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改车辆信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-form-item label="车牌号码" prop="vehicleLicenseNumber">
          <el-input v-model="form.vehicleLicenseNumber" placeholder="请输入车牌号码" clearable />
        </el-form-item>
        <!--el-form-item label="车牌颜色" prop="vehicleLicenseColor">
          <el-select v-model="form.vehicleLicenseColor" placeholder="请选择车牌颜色" clearable>
            <el-option
              v-for="dict in dict.type.vehicle_license_color"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="车辆类型" prop="vehicleType">
          <el-select v-model="form.vehicleType" placeholder="请选择车辆类型" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.vehicle_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <!--el-form-item label="能源类型" prop="energyType">
          <el-select v-model="form.energyType" placeholder="请选择能源类型" clearable>
            <el-option
              v-for="dict in dict.type.energy_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="排放标准" prop="exhaustEmissionStandard">
          <el-select v-model="form.exhaustEmissionStandard" placeholder="请选择排放标准" clearable>
            <el-option
              v-for="dict in dict.type.exhaust_emission_standard"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="所属单位/个人" prop="vehicleOwner">
          <el-input v-model="form.vehicleOwner" placeholder="请输入所属单位/个人" clearable />
        </el-form-item>
        <el-form-item label="住址" prop="vehicleAddress">
          <el-input v-model="form.vehicleAddress" placeholder="请输入住址" clearable />
        </el-form-item>
        <el-form-item label="使用性质" prop="usePurpose">
          <el-select v-model="form.usePurpose" placeholder="请选择使用性质" clearable>
            <el-option
              v-for="dict in dict.type.use_purpose"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="车辆品牌" prop="vehicleBrand">
          <el-input v-model="form.vehicleBrand" placeholder="请输入车辆品牌" clearable />
        </el-form-item>
        <el-form-item label="车识别代号" prop="vin">
          <el-input v-model="form.vin" placeholder="请输入车识别代号" clearable />
        </el-form-item>
        <el-form-item label="发动机号" prop="engineNumber">
          <el-input v-model="form.engineNumber" placeholder="请输入发动机号" clearable />
        </el-form-item>
        <el-form-item label="注册日期" prop="registerDate">
          <el-date-picker clearable
            v-model="form.registerDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择注册日期"
            >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="发证日期" prop="licenceIssueDate">
          <el-date-picker clearable
            v-model="form.licenceIssueDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择发证日期"
            >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="发证机关" prop="licenceIssueAuthority">
          <el-input v-model="form.licenceIssueAuthority" placeholder="请输入发证机关" clearable />
        </el-form-item>
        <el-form-item label="行驶证号" prop="driveLicenseNumber">
          <el-input v-model="form.driveLicenseNumber" placeholder="请输入行驶证号" clearable />
        </el-form-item>
        <el-form-item label="核定载人数" prop="approvePassenger">
          <el-input v-model="form.approvePassenger" placeholder="请输入核定载人数" clearable />
        </el-form-item>
        <el-form-item label="总质量" prop="totalWeight">
          <el-input v-model="form.totalWeight" placeholder="请输入总质量" clearable />
        </el-form-item>
        <el-form-item label="整备质量" prop="massWeight">
          <el-input v-model="form.massWeight" placeholder="请输入整备质量" clearable />
        </el-form-item>
        <el-form-item label="核定载质量" prop="approveLoadWeight">
          <el-input v-model="form.approveLoadWeight" placeholder="请输入核定载质量" clearable />
        </el-form-item>
        <el-form-item label="准牵引总质量" prop="approveTowMass">
          <el-input v-model="form.approveTowMass" placeholder="请输入准牵引总质量" clearable />
        </el-form-item>
        <el-form-item label="长（米）" prop="vehicleLong">
          <el-input v-model="form.vehicleLong" placeholder="请输入长" clearable />
        </el-form-item>
        <el-form-item label="宽（米）" prop="vehicleWide">
          <el-input v-model="form.vehicleWide" placeholder="请输入宽" clearable />
        </el-form-item>
        <el-form-item label="高（米）" prop="vehicleHigh">
          <el-input v-model="form.vehicleHigh" placeholder="请输入高" clearable />
        </el-form-item>
        <el-form-item label="购买日期" prop="purchaseDate">
          <el-date-picker clearable
            v-model="form.purchaseDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择购买日期"
            >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="道路运输证号" prop="transportCertificateNumber">
          <el-input v-model="form.transportCertificateNumber" placeholder="请输入道路运输证号" clearable />
        </el-form-item>
        <el-form-item label="经营许可证" prop="roadOperationLicense">
          <el-input v-model="form.roadOperationLicense" placeholder="请输入道路经营许可证" clearable />
        </el-form-item>
        <el-form-item label="车辆标记" prop="vehicleMark">
          <el-select v-model="form.vehicleMark" placeholder="请选择车辆标记" clearable>
            <el-option
              v-for="dict in dict.type.vehicle_mark"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item-->
        <!--el-form-item label="保险公司" prop="insuranceCompany">
          <el-input v-model="form.insuranceCompany" placeholder="请输入保险公司" clearable />
        </el-form-item>
        <el-form-item label="交强险单号" prop="compulsoryInsuranceNumber">
          <el-input v-model="form.compulsoryInsuranceNumber" placeholder="请输入交强险单号" clearable />
        </el-form-item>
        <el-form-item label="交强险开始日期" prop="compulsoryInsuranceBegin">
          <el-date-picker clearable
            v-model="form.compulsoryInsuranceBegin"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择交强险开始日期"
            >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="交强险结束日期" prop="compulsoryInsuranceEnd">
          <el-date-picker clearable
            v-model="form.compulsoryInsuranceEnd"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择交强险结束日期"
            >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="交强险保费" prop="compulsoryInsurancePremium">
          <el-input v-model="form.compulsoryInsurancePremium" placeholder="请输入交强险保费" clearable />
        </el-form-item>
        <el-form-item label="交强险理赔" prop="compulsoryInsuranceHighestClaim">
          <el-input v-model="form.compulsoryInsuranceHighestClaim" placeholder="请输入交强险理赔" clearable />
        </el-form-item>
        <el-form-item label="商业险单号" prop="commercialInsuranceNumber">
          <el-input v-model="form.commercialInsuranceNumber" placeholder="请输入商业险单号" clearable />
        </el-form-item>
        <el-form-item label="商业险开始日期" prop="commercialInsuranceBegin">
          <el-date-picker clearable
            v-model="form.commercialInsuranceBegin"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择商业险开始日期"
            >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="商业险结束日期" prop="commercialInsuranceEnd">
          <el-date-picker clearable
            v-model="form.commercialInsuranceEnd"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择商业险结束日期"
            >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="商业险保费" prop="commercialInsurancePremium">
          <el-input v-model="form.commercialInsurancePremium" placeholder="请输入商业险保费" clearable />
        </el-form-item>
        <el-form-item label="商业险理赔" prop="commercialInsuranceHighestClaim">
          <el-input v-model="form.commercialInsuranceHighestClaim" placeholder="请输入商业险理赔" clearable />
        </el-form-item-->
        <el-form-item label="车辆年检" prop="vehicleInspectionExpire">
          <el-date-picker clearable
            v-model="form.vehicleInspectionExpire"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择车辆年检"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <!--el-form-item label="气罐年检" prop="gastankInspectionExpire">
          <el-date-picker clearable
            v-model="form.gastankInspectionExpire"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择气罐年检"
            >
          </el-date-picker>
        </el-form-item-->
        <el-form-item label="强制报废" prop="forceScrapExpire">
          <el-date-picker clearable
            v-model="form.forceScrapExpire"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择强制报废"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="车辆状态" prop="status">
          <el-select v-model="form.status" placeholder="请选择车辆状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.vehicle_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" clearable />
        </el-form-item>
        <!--div class="dashed-line" />
        <el-form-item label="行驶证主页" prop="drivepermitHomepagePicture">
          <image-upload v-model="form.drivepermitHomepagePicture" :limit="1"/>
        </el-form-item>
        <el-form-item label="行驶证副页" prop="drivepermitSubpagePicture">
          <image-upload v-model="form.drivepermitSubpagePicture" :limit="1"/>
        </el-form-item>
        <el-form-item label="道路运输证" prop="transportCertificatePicture">
          <image-upload v-model="form.transportCertificatePicture" :limit="1"/>
        </el-form-item>
        <el-form-item label="道路经营许可证" prop="operationLicensePicture">
          <image-upload v-model="form.operationLicensePicture" :limit="1"/>
        </el-form-item>
        <el-form-item label="车头照片" prop="tractorHeaderPicture">
          <image-upload v-model="form.tractorHeaderPicture" :limit="1"/>
        </el-form-item-->
        <!--el-form-item label="挂靠声明" prop="affiliationStatementPicture">
          <image-upload v-model="form.affiliationStatementPicture" :limit="1"/>
        </el-form-item-->
        <!--el-form-item label="园区代码" prop="parkCode">
          <el-input v-model="form.parkCode" placeholder="请输入园区代码" clearable />
        </el-form-item-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listIntervehicle, getIntervehicle, delIntervehicle, addIntervehicle, updateIntervehicle } from "@/api/vehicles/intervehicle";

export default {
  name: "Intervehicle",
  dicts: ['vehicle_mark', 'vehicle_status', 'vehicle_license_color', 'energy_type', 'exhaust_emission_standard', 'vehicle_type', 'use_purpose'],
  data() {
    return {
      // 定义列表高度
      tableHeight: 430,
      // 定义查询高度
      queryHeight: 200,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 车辆信息表格数据
      intervehicleList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 园区代码时间范围
      daterangeRegisterDate: [],
      // 园区代码时间范围
      daterangeLicenceIssueDate: [],
      // 园区代码时间范围
      daterangePurchaseDate: [],
      // 园区代码时间范围
      daterangeCompulsoryInsuranceBegin: [],
      // 园区代码时间范围
      daterangeCompulsoryInsuranceEnd: [],
      // 园区代码时间范围
      daterangeCommercialInsuranceBegin: [],
      // 园区代码时间范围
      daterangeCommercialInsuranceEnd: [],
      // 园区代码时间范围
      daterangeVehicleInspectionExpire: [],
      // 园区代码时间范围
      daterangeGastankInspectionExpire: [],
      // 园区代码时间范围
      daterangeCreateTime: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        vehicleLicenseNumber: null,
        vehicleLicenseColor: null,
        vehicleType: null,
        energyType: null,
        exhaustEmissionStandard: null,
        vehicleOwner: null,
        vehicleAddress: null,
        usePurpose: null,
        vehicleBrand: null,
        vin: null,
        engineNumber: null,
        registerDate: null,
        licenceIssueDate: null,
        licenceIssueAuthority: null,
        driveLicenseNumber: null,
        approvePassenger: null,
        totalWeight: null,
        massWeight: null,
        approveLoadWeight: null,
        approveTowMass: null,
        vehicleLong: null,
        vehicleWide: null,
        vehicleHigh: null,
        purchaseDate: null,
        transportCertificateNumber: null,
        roadOperationLicense: null,
        vehicleMark: null,
        insuranceCompany: null,
        compulsoryInsuranceNumber: null,
        compulsoryInsuranceBegin: null,
        compulsoryInsuranceEnd: null,
        compulsoryInsurancePremium: null,
        compulsoryInsuranceHighestClaim: null,
        commercialInsuranceNumber: null,
        commercialInsuranceBegin: null,
        commercialInsuranceEnd: null,
        commercialInsurancePremium: null,
        commercialInsuranceHighestClaim: null,
        vehicleInspectionExpire: null,
        gastankInspectionExpire: null,
        forceScrapExpire: null,
        status: null,
        remark: null,
        drivepermitHomepagePicture: null,
        drivepermitSubpagePicture: null,
        transportCertificatePicture: null,
        operationLicensePicture: null,
        tractorHeaderPicture: null,
        affiliationStatementPicture: null,
        parkCode: null,
        createBy: null,
        createTime: null,
      },
      // 表单参数
      form: {},
      // 车辆标识
      vehicleMark: '自有车辆',
      // 表单校验
      rules: {
        vehicleLicenseNumber: [
          { required: true, message: "车牌号码不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  mounted() {
    this.$nextTick(() =>{
      // 根据浏览器高度设置初始高度 - 按钮行高度28 - 页码行高度28 - （面包屑+TAB行）高度160
      this.queryHeight = this.$refs.queryForm.$el.offsetHeight;
      this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 28 - 28 - 160;
      // 监听浏览器高度变化，改变表格高度
      window.onresize = () =>{
        this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 28 - 28 - 160;
      }
    })
  },
  methods: {
    /** 查询车辆信息列表 */
    getList() {
      this.queryParams.vehicleMark = this.vehicleMark;
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.daterangeRegisterDate && '' != this.daterangeRegisterDate) {
        this.queryParams.params["beginRegisterDate"] = this.daterangeRegisterDate[0];
        this.queryParams.params["endRegisterDate"] = this.daterangeRegisterDate[1];
      }
      if (null != this.daterangeLicenceIssueDate && '' != this.daterangeLicenceIssueDate) {
        this.queryParams.params["beginLicenceIssueDate"] = this.daterangeLicenceIssueDate[0];
        this.queryParams.params["endLicenceIssueDate"] = this.daterangeLicenceIssueDate[1];
      }
      if (null != this.daterangePurchaseDate && '' != this.daterangePurchaseDate) {
        this.queryParams.params["beginPurchaseDate"] = this.daterangePurchaseDate[0];
        this.queryParams.params["endPurchaseDate"] = this.daterangePurchaseDate[1];
      }
      if (null != this.daterangeCompulsoryInsuranceBegin && '' != this.daterangeCompulsoryInsuranceBegin) {
        this.queryParams.params["beginCompulsoryInsuranceBegin"] = this.daterangeCompulsoryInsuranceBegin[0];
        this.queryParams.params["endCompulsoryInsuranceBegin"] = this.daterangeCompulsoryInsuranceBegin[1];
      }
      if (null != this.daterangeCompulsoryInsuranceEnd && '' != this.daterangeCompulsoryInsuranceEnd) {
        this.queryParams.params["beginCompulsoryInsuranceEnd"] = this.daterangeCompulsoryInsuranceEnd[0];
        this.queryParams.params["endCompulsoryInsuranceEnd"] = this.daterangeCompulsoryInsuranceEnd[1];
      }
      if (null != this.daterangeCommercialInsuranceBegin && '' != this.daterangeCommercialInsuranceBegin) {
        this.queryParams.params["beginCommercialInsuranceBegin"] = this.daterangeCommercialInsuranceBegin[0];
        this.queryParams.params["endCommercialInsuranceBegin"] = this.daterangeCommercialInsuranceBegin[1];
      }
      if (null != this.daterangeCommercialInsuranceEnd && '' != this.daterangeCommercialInsuranceEnd) {
        this.queryParams.params["beginCommercialInsuranceEnd"] = this.daterangeCommercialInsuranceEnd[0];
        this.queryParams.params["endCommercialInsuranceEnd"] = this.daterangeCommercialInsuranceEnd[1];
      }
      if (null != this.daterangeVehicleInspectionExpire && '' != this.daterangeVehicleInspectionExpire) {
        this.queryParams.params["beginVehicleInspectionExpire"] = this.daterangeVehicleInspectionExpire[0];
        this.queryParams.params["endVehicleInspectionExpire"] = this.daterangeVehicleInspectionExpire[1];
      }
      if (null != this.daterangeGastankInspectionExpire && '' != this.daterangeGastankInspectionExpire) {
        this.queryParams.params["beginGastankInspectionExpire"] = this.daterangeGastankInspectionExpire[0];
        this.queryParams.params["endGastankInspectionExpire"] = this.daterangeGastankInspectionExpire[1];
      }
      if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
        this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
        this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
      }
      listIntervehicle(this.queryParams).then(response => {
        this.intervehicleList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        vehicleId: null,
        vehicleLicenseNumber: null,
        vehicleLicenseColor: null,
        vehicleType: null,
        energyType: null,
        exhaustEmissionStandard: null,
        vehicleOwner: null,
        vehicleAddress: null,
        usePurpose: null,
        vehicleBrand: null,
        vin: null,
        engineNumber: null,
        registerDate: null,
        licenceIssueDate: null,
        licenceIssueAuthority: null,
        driveLicenseNumber: null,
        approvePassenger: null,
        totalWeight: null,
        massWeight: null,
        approveLoadWeight: null,
        approveTowMass: null,
        vehicleLong: null,
        vehicleWide: null,
        vehicleHigh: null,
        purchaseDate: null,
        transportCertificateNumber: null,
        roadOperationLicense: null,
        vehicleMark: null,
        insuranceCompany: null,
        compulsoryInsuranceNumber: null,
        compulsoryInsuranceBegin: null,
        compulsoryInsuranceEnd: null,
        compulsoryInsurancePremium: null,
        compulsoryInsuranceHighestClaim: null,
        commercialInsuranceNumber: null,
        commercialInsuranceBegin: null,
        commercialInsuranceEnd: null,
        commercialInsurancePremium: null,
        commercialInsuranceHighestClaim: null,
        vehicleInspectionExpire: null,
        gastankInspectionExpire: null,
        forceScrapExpire: null,
        status: null,
        remark: null,
        drivepermitHomepagePicture: null,
        drivepermitSubpagePicture: null,
        transportCertificatePicture: null,
        operationLicensePicture: null,
        tractorHeaderPicture: null,
        affiliationStatementPicture: null,
        dataRealm: null,
        parkCode: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeRegisterDate = [];
      this.daterangeLicenceIssueDate = [];
      this.daterangePurchaseDate = [];
      this.daterangeCompulsoryInsuranceBegin = [];
      this.daterangeCompulsoryInsuranceEnd = [];
      this.daterangeCommercialInsuranceBegin = [];
      this.daterangeCommercialInsuranceEnd = [];
      this.daterangeVehicleInspectionExpire = [];
      this.daterangeGastankInspectionExpire = [];
      this.daterangeCreateTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.vehicleId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加车辆信息";
      this.$set(this.form, 'vehicleMark', this.vehicleMark);
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const vehicleId = row.vehicleId || this.ids
      getIntervehicle(vehicleId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改车辆信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.vehicleId != null) {
            updateIntervehicle(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addIntervehicle(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const vehicleIds = row.vehicleId || this.ids;
      this.$modal.confirm('是否确认删除车辆信息编号为"' + vehicleIds + '"的数据项？').then(function() {
        return delIntervehicle(vehicleIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('vehicles/vehicle/export', {
        ...this.queryParams
      }, `自有车辆_${this.parseTime(new Date(), '{y}{m}{d}_{h}{i}')}.xlsx`)
    },
    computeTableHeight(){
      if( this.showSearch==true ){
        this.tableHeight = window.innerHeight - this.queryHeight - 28 - 28 - 160;
      } else {
        this.tableHeight = window.innerHeight - 28 - 28 - 160;
      }
    },
    // 日期提醒
    expireTableCellClassName ({ row, column, rowIndex, columnIndex }) {
      let nowDate = new Date().getTime();
      let expireDate = 0;
      //交强险到期提醒
      if (column.property == 'compulsoryInsuranceEnd') {
//        console.log('nowDate X', nowDate);
//        console.log('row', row);
//        console.log('rowIndex', rowIndex);
//        console.log('column', column);
//        console.log('columnIndex', columnIndex);
        expireDate = new Date(row.compulsoryInsuranceEnd).getTime();
//        console.log('expireDate X', expireDate);
        if (expireDate <= nowDate) {
//          console.log('row.compulsoryInsuranceExpire 1051', row.compulsoryInsuranceExpire);
          return 'color-date-danger'
        }
        if (expireDate < nowDate + 30 * 8.64e7) {
//          console.log('row.compulsoryInsuranceExpire 1055', row.compulsoryInsuranceExpire);
          return 'color-date-warning'
        }
      } else {
        //console.log('1059');
      }
      //商业险到期提醒
      if (column.property == 'commercialInsuranceEnd') {
        expireDate = new Date(row.commercialInsuranceEnd).getTime();
        if (expireDate <= nowDate) {
          return 'color-date-danger'
        }
        if (expireDate < nowDate + 30 * 8.64e7) {
          return 'color-date-warning'
        }
      } 
      //车辆年检到期提醒，1年
      if (column.property == 'vehicleInspectionExpire') {
        expireDate = new Date(row.vehicleInspectionExpire).getTime();
        if (expireDate <= nowDate) {
          return 'color-date-danger'
        }
        if (expireDate < nowDate + 30 * 8.64e7) {
          return 'color-date-warning'
        }
      } 
      //气罐年检到期提醒，3年
      if (column.property == 'gastankInspectionExpire') {
        expireDate = new Date(row.gastankInspectionExpire).getTime();
        if (expireDate <= nowDate) {
          return 'color-date-danger'
        }
        if (expireDate < nowDate + 30 * 8.64e7) {
          return 'color-date-warning'
        }
      } 
    }

  }
};
</script>

<style scoped lang='less'>
/*/deep/的意思大概为深入的，深远的。Scoped CSS规范是Web组件产生不污染其他组件，也不被其他组件污染的CSS规范。*/
/*在打包的时候会生成一个独一无二hash值，这样父组件的样式就不会影响到子组件了，要想修改子组件的样式，*/
/*一般是提取一个公共文件，在公共文件里面修改样式.提取公共文件的方式来修改，以达到自己想要的，但是同时其他地方也会受到影响*/
/*需要有一个方法或者方式，既不影响到别的地方，又能修改子组件在当前的样式。*/
/deep/.color-date-danger{
  background: red;
}
/deep/.color-date-warning{
  background: rgb(255, 255, 0);
}

</style>


<style scoped lang='less'>
/* 横线 */
.dashed-line{
  border-top: 2px dashed #cac7c7; /* 虚线的宽度、样式和颜色 */
  width: 90%;
  height: 1px;
  margin-left: 40px;
  margin-top: -0.50em;
  margin-bottom: 0.75em;
//  margin:0 auto;
  position: relative;
  text-align: center;
}

//.dashed-line {
//  border-top: 2px dashed #000; /* 虚线的宽度、样式和颜色 */
//  width: 100%; /* 虚线的长度 */
//  margin: 10px 0; /* 虚线的上下间距 */
//}

.el-picker {
  width: 200px !important;
}
.el-select{
  width: 200px;
}
//.el-input{
//  width: 200px;
//}
.address{
  width: 510px;
}

.remark{
  width: 510px;
}
</style>